$OpenBSD: patch-server_Makefile,v 1.11 2013/03/17 09:47:07 ajacoutot Exp $
--- server/Makefile.orig	Sat Oct  2 18:21:01 2010
+++ server/Makefile	Sun Mar 17 10:40:23 2013
@@ -3,12 +3,9 @@ PKG_CONFIG ?= pkg-config
 BINMODE ?= 755
 BINEXT ?=
 
-INSTALLROOT ?= $(DESTDIR)$(PREFIX)
-ifeq ($(INSTALLROOT),)
-	INSTALLROOT = /usr/local
-endif
+INSTALLROOT ?= $(PREFIX)
 
-SINSTALLDIR ?= $(INSTALLROOT)/bin
+SINSTALLDIR ?= $(INSTALLROOT)/sbin
 INSTALLDIRMODE ?= 755
 
 INCLUDEDIR ?= $(INSTALLROOT)/include
@@ -22,11 +19,11 @@ CFGDIR ?= $(INSTALLROOT)/etc
 CFGDIRMODE ?= 755
 CFGMODE ?= 644
 
-SMANDIR ?= $(INSTALLROOT)/share/man/man1
+SMANDIR ?= $(INSTALLROOT)/man/man1
 MANMODE ?= 644
 MANDIRMODE ?= 755
 INSTALL ?= install
-LINK_FLAGS ?= -Wl,-E
+LINK_FLAGS ?= -Wl
 EXTRAOBJS =
 
 SHARED_PATH = ../shared
@@ -60,13 +57,13 @@ PKG_LIB = `$(PKG_CONFIG) --libs glib-2.0 gmodule-2.0 g
 GLIB12_INCLUDE = `glib-config --cflags`
 GLIB12_LIB = `glib-config --libs glib gmodule`
 
-FLAGS = -O2 $(PKG_INCLUDE)
+FLAGS = $(PKG_INCLUDE)
 
 ifeq ($(glib12),1)
-    FLAGS = -O2 $(GLIB12_INCLUDE)
+    FLAGS = $(GLIB12_INCLUDE)
 endif
 ifeq ($(glib12),yes)
-    FLAGS = -O2  $(GLIB12_INCLUDE)
+    FLAGS = $(GLIB12_INCLUDE)
 endif
 FLAGS += $(GTOP_INCLUDE) $(PTHREAD_INC) -I.. -I$(SHARED_PATH) -DGKRELLM_SERVER
 
@@ -107,6 +104,8 @@ endif
 ifeq ($(HAVE_GETADDRINFO),1)
     FLAGS += -DHAVE_GETADDRINFO
 endif
+
+CFLAGS += $(FLAGS)
 
 OS_NAME=$(shell uname -s)
 OS_RELEASE=$(shell uname -r)
